<%--
  Created by IntelliJ IDEA.
  User: 122
  Date: 2024/1/7
  Time: 14:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ncist.utils.MybatisUtils" %>
<%@ page import="com.ncist.dao.MessagesDao" %>
<%@ page import="org.apache.ibatis.session.SqlSession" %>
<%@ page import="com.ncist.dao.UserDao" %>
<html>
<body>
<%
    request.setCharacterEncoding("UTF-8");
    String name = request.getParameter("uname");
    String pwd = request.getParameter("upwd");

    String flag1=null;
    SqlSession sqlSession;
    sqlSession = MybatisUtils.getSqlSession();
    UserDao mapper = sqlSession.getMapper(UserDao.class);
    System.out.println("赋值前"+flag1+name+pwd);
    flag1=mapper.select(name,pwd);
    System.out.println("赋值后"+flag1);

    //关闭sqlSession
    sqlSession.close();
    request.setAttribute("flag1", flag1);
    request.getRequestDispatcher("/index.jsp").forward(request, response);

%>
</body>
</html>
